import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * Description:OutputStream的使用
 * Author: WJW
 * Date: 2024-08-20
 * Time: 22:04
 */
public class IODemo3 {
    public static void main(String[] args) {
        //通过OutputStream来写文件
        //append追加
        try(OutputStream outputStream = new FileOutputStream("./test.txt",true)){
            byte[] buffer = new byte[]{ 97,98,99,100};
            outputStream.write(buffer);
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
